#pragma once

#include "e2d/core/pch.h"
#include "e2d/core/Component.h"
#include "fxcc/core/graph/common/Transform.h"

namespace e2d
{
	struct  TransformNode :public Component
	{
		FXCC_DEFINE_COMPONENT_LABEL(TransformNode);

        fxcc::graph::common::Transform m_Local;

        fxcc::graph::common::Transform m_World;

		glm::vec3 m_TargetPos{ 0.0f };

		void LookAtTarget();

		glm::mat4 GetWorldMatrix() const;
		
		glm::mat4 GetParentMatrix() const;

		void ResetLocalFromWorld() ;

		void SetWorldMatrix(const glm::mat4& world);

		void SetWorldTransform(const e2d::Transform& worldTransform);

		void OnUpdate();
	};
};